/* 
  并且显示路径对应的目标内容
*/
import Vue from 'vue'
import Router from 'vue-router'

// 目标组件懒加载
const home = () => import('../views/home/Home.vue')
const cart = () => import('../views/cart/Cart.vue')
const category = () => import('../views/category/Category.vue')
const profile =()=>import('../views/profile/Profile.vue')
Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '',
      redirect:'/home'
    },
    {
      path: '/home',
      component:home
    },
    {
      path: '/shopcart',
      component:cart
    },
    {
      path: '/category',
      component:category
    },
    {
      path: '/profile',
      component:profile
    }
  ],
  mode:'history'
})
